package com.powerdata.core.paimon.bean.table;


public class TableColumnsBean {
    private Integer id;//id序号
    private String columnName;//字段名
    private String dataType;//类型
    private String comment;//注释
    // 是否可为空
    private String isNullable;
    private String isPrimaryKey;
    private String isPartitionKey;

    private Integer precision;
    private Integer scale;

    public TableColumnsBean() {
    }

    public TableColumnsBean(Integer id, String fieldName, String types, String description, boolean isOptional) {
        this.id = id;
        this.columnName = fieldName;
        this.dataType = types;
        this.comment = description;
        this.isNullable = isOptional ? "0" : "1";
        this.isPrimaryKey = "0";
        this.isPartitionKey = "0";
    }

    public TableColumnsBean(Integer id, String fieldName, String types, String description, boolean isOptional, boolean isPrimaryKey, boolean isPartitionKey) {
        this.id = id;
        this.columnName = fieldName;
        this.dataType = types;
        this.comment = description;
        this.isNullable = isOptional ? "0" : "1";
        this.isPrimaryKey = isPrimaryKey ? "1" : "0";
        this.isPartitionKey = isPartitionKey ? "1" : "0";
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getColumnName() {
        return columnName;
    }

    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }

    public String getDataType() {
        return dataType;
    }

    public void setDataType(String dataType) {
        this.dataType = dataType;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getIsNullable() {
        return isNullable;
    }

    public void setIsNullable(String isNullable) {
        this.isNullable = isNullable;
    }

    public String getIsPrimaryKey() {
        return isPrimaryKey;
    }

    public void setIsPrimaryKey(String isPrimaryKey) {
        this.isPrimaryKey = isPrimaryKey;
    }

    public String getIsPartitionKey() {
        return isPartitionKey;
    }

    public void setIsPartitionKey(String isPartitionKey) {
        this.isPartitionKey = isPartitionKey;
    }

    public Integer getPrecision() {
        return precision;
    }

    public void setPrecision(Integer precision) {
        this.precision = precision;
    }

    public Integer getScale() {
        return scale;
    }

    public void setScale(Integer scale) {
        this.scale = scale;
    }
}
